import { AfterViewInit, Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-monitor',
  templateUrl: './monitor.component.html',
  styleUrls: ['./monitor.component.scss'],
})
export class MonitorComponent implements OnInit, AfterViewInit {
  inputType = 'password';
  inputType1 = 'password';
  changeType = true;
  number = 0;
  itemImageUrl =
    'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1606923883689&di=65fdbe5b3fde35a237174641f5256b52&imgtype=0&src=http%3A%2F%2Fa4.att.hudong.com%2F27%2F67%2F01300000921826141299672233506.jpg';
  title = 'Title111';
  currentCustomer = '111';
  editStr = 'This is an editable text.';
  customEditIconStr = 'Custom edit icon and tooltip text.';
  hideEditTooltipStr = 'Hide edit tooltip. ';
  copyStr = 'This is a copyable text.';
  copyHideTooltipStr = 'Hide copy tooltips.';
  dynamicContent =
    'Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design, a design language for background applications, is refined by Ant UED Team. Ant Design';
  content =
    "To be, or not to be, that is a question: Whether it is nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them? To die: to sleep; No more; and by a sleep to say we end The heart-ache and the thousand natural shocks That flesh is heir to, 'tis a consummation Devoutly to be wish'd. To die, to sleep To sleep- perchance to dream: ay, there's the rub! For in that sleep of death what dreams may come When we have shuffled off this mortal coil, Must give us pause. There 's the respect That makes calamity of so long life ";
  suffix = '--William Shakespeare';
  rows = 1;
  customers = ['ca', 'cb', 'cc'];
  currentItem = 'currentA';
  isSpecial = false;
  currentDate = 4;
  date = 0;
  item = null;
  items: any[] = [];
  constructor() {}
  ngAfterViewInit(): void {
    setTimeout(() => {
      this.title = 'bbb';
    }, 3000);
  }

  ngOnInit(): void {}
  onChange(event: string): void {
    this.dynamicContent = event;
  }

  onEllipsisChange(ellipsis: boolean): void {
    console.log(ellipsis);
  }

  getVal() {
    return 'abc';
  }

  clicknumber() {
    this.number = this.number + 1;
  }

  changeInputType() {
    this.inputType = 'text';
  }

  changeInputType1() {
    if (this.changeType) {
      this.inputType1 = 'text';
      this.changeType = false;
    } else {
      this.inputType1 = 'password';
      this.changeType = true;
    }
  }

  showcurrentItem() {
    console.info(this.currentItem);
  }

  datePlus() {
    this.date = this.date + 1;
  }
  showitem() {
    console.info(this.item);
    this.items.push(this.item);
  }
  clearitem() {
    this.items=[];
    this.item=null;
  }
}
